<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>判断顾客是否能享受优惠</title>
</head>
<body>
    <script>
        function pds(a1,a2,a3){
            var tp=a1+a2+a3
            return tp
        }
        function sum(a1,a2,a3){
            var m=pds(a1,a2,a3)
            document.write("顾客一共消费："+m+"元</br>")
            if(m>=500){
            document.write("这位顾客可以享受9折优惠")
            }else{
            document.write("这位顾客不可以享受9折优惠")
            }
        }
        sum(199,156,165);
    </script>
</body>
</html>